#!/usr/bin/env python 
# -*- coding:utf-8 -*-

from sklearn.naive_bayes import GaussianNB
import numpy as np

if __name__ == "__main__":
    data1 = "50001_6_5,4,3,6_3,2,1,4"
    data2 = "50002_3_5,4,3,6_3,3,2,5"
    data_array = [data1, data2]
    for data_line in data_array:
        data_info = data_line.split("_")
        station_id = data_info[0]
        x_test = np.asarray(data_info[1], dtype=np.float32)
        x_train = np.asarray(data_info[2].split(","), dtype=np.float32)
        y_train = np.asarray(data_info[3].split(","), dtype=np.float32)
        clf = GaussianNB()
        clf.fit(x_train.reshape(x_train.size, 1), y_train.reshape(y_train.size, 1))
        y_predict = clf.predict(x_test.reshape(1, -1))
        print(str(station_id) + ":" + str(y_predict[0]))
